package cc.mrbird.assets.service;

import cc.mrbird.assets.domain.AssetType;
import cc.mrbird.common.domain.QueryRequest;
import cc.mrbird.unit.domain.UnitType;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

@CacheConfig(cacheNames = "AssetTypeService")
public interface AssetTypeService {
    List<AssetType> findAllList(AssetType assetType, QueryRequest request);

    AssetType findByName(String asset_type_name);

    @CacheEvict(allEntries = true)
    void add(AssetType assetType);

    @CacheEvict(key = "#p0", allEntries = true)
    void update(AssetType assetType);

    @CacheEvict(key = "#p0", allEntries = true)
    void delete(String ids);

    @Cacheable(key = "#p0")
    public AssetType findById(Long id);
}
